//
// Created by wyh on 2025-06-22 10:40.
//
#include <iostream>
#include "utility/string.h"

using namespace std;
using namespace wyh::utility;

int main(int argc, char **argv)
{
    std::cout << String::to_lower("HELLO WORLD") << std::endl;
    std::cout << String::to_upper("nihao") << std::endl;

    std::cout << "----------------------------" << std::endl;

    std::cout << String::ltrim("HELLO WORLD", "EH") << std::endl;
    std::cout << String::rtrim("nihao", "ao") << std::endl;
    std::cout << String::trim("wuhandonghugaoxinqu", "wqu") << std::endl;
    std::cout << String::trim("hwuhandonghugaoxinquhw", "wh") << std::endl;

    const std::string &input = "root/a/b/c";

    std::vector<std::string> output = String::split(input, '/');
    for (auto &s: output)
    {
        std::cout << s << ",";
    }
    std::cout << std::endl;

    std::vector<std::string> input1;
    input1.emplace_back("hello");
    input1.emplace_back("nihao");
    input1.emplace_back("world");

    std::cout << String::join(input1, '-') << std::endl;

    std::cout << String::capitalize("hello world") << std::endl;

    std::cout << String::format("name=%s,age=%d", "jack", 18) << std::endl;

    std::cout << "reboot has prefix re?(" << String::has_prefix("reboot", "re") << ")" << std::endl;
    std::cout << "reboot has prefix Re?(" << String::has_prefix("reboot", "Re") << ")" << std::endl;

    std::cout << "citing has suffix ing?(" << String::has_suffix("citing", "ing") << ")" << std::endl;
    std::cout << "citing has suffix inG?(" << String::has_prefix("citing", "inG") << ")" << std::endl;

    return 0;
}